#include "Thing.hpp"

class myGame : public Thing::Game 
{
public:
    myGame(int argc, char* argv[]) : Thing::Game(argc, argv) {}
    ~myGame() {}

    void update()
    {
        Thing::Game::update();
        testKeys();
    }

    void initialize()
    {
        ACTIVE_LOG_TYPE( Thing::Utils::Logger::M_DBG | Thing::Utils::Logger::M_WARN );
        Thing::Game::initialize(Thing::Video::VideoMode(640, 480, 32, Thing::Video::VideoManager::Flag::SOFT_RENDER));
        Thing::Globals::event->showMouseCursor(true);
        setName("My First Game");
    }

    void quit()
    {
        DBG("LETS QUIT");
        Thing::Game::quit();
    }

    void testKeys()
    {
        if(Thing::Globals::event->onKeyPressed(Thing::Events::Keyboard::Key::ESCAPE)) quit();
        if(Thing::Globals::event->onWindowQuit()) quit();
    }
};

int main ( int argc, char* argv[] )
{
    myGame game(argc, argv);
    game.initialize();
    return game.exec();
}
